using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TraceNetworkTools
{
    /// <summary>
    /// <para>Enable Network Topology</para>
    /// <para>Enables a network topology for a trace network.</para>
    /// <para>为追踪网络启用网络拓扑。</para>
    /// </summary>    
    [DisplayName("Enable Network Topology")]
    public class EnableNetworkTopology : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EnableNetworkTopology()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_trace_network">
        /// <para>Input Trace Network</para>
        /// <para>The trace network for which the network topology will be enabled.</para>
        /// <para>将为其启用网络拓扑的跟踪网络。</para>
        /// </param>
        public EnableNetworkTopology(object _in_trace_network)
        {
            this._in_trace_network = _in_trace_network;
        }
        public override string ToolboxName => "Trace Network Tools";

        public override string ToolName => "Enable Network Topology";

        public override string CallName => "tn.EnableNetworkTopology";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_trace_network, _max_number_of_errors, _only_generate_errors.GetGPValue(), _out_trace_network];

        /// <summary>
        /// <para>Input Trace Network</para>
        /// <para>The trace network for which the network topology will be enabled.</para>
        /// <para>将为其启用网络拓扑的跟踪网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Trace Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_trace_network { get; set; }


        /// <summary>
        /// <para>Maximum number of errors</para>
        /// <para><xdoc>
        ///   <para>The maximum number of errors that can occur before the process of enabling the network topology will stop. Errors will be recorded in the errors table. The default value is 10000.</para>
        ///   <para>Increasing the maximum number of errors value will increase the length of time it takes to enable the topology. Setting a value higher than the default value of 10000 is not recommended.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在启用网络拓扑的过程停止之前可能发生的最大错误数。错误将记录在错误表中。默认值为 10000。</para>
        ///   <para>增加最大错误数值将增加启用拓扑所需的时间长度。不建议设置高于默认值 10000 的值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum number of errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _max_number_of_errors { get; set; } = 10000;


        /// <summary>
        /// <para>Only generate errors</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the topology will be enabled or only network errors will be generated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The trace network will only be evaluated for network errors The topology will not be enabled. This allows you to inspect and fix errors in the network before you enable the topology. If you are working with an enterprise geodatabase, the data cannot be registered as versioned. This allows you to inspect and fix errors in the network until you enable the topology.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The topology will be enabled and any errors that exist will generate error features. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是启用拓扑还是仅生成网络错误。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将仅评估追踪网络是否存在网络错误 不会启用拓扑。这允许您在启用拓扑之前检查和修复网络中的错误。如果使用的是企业级地理数据库，则无法将数据注册为版本。这允许您检查和修复网络中的错误，直到启用拓扑。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将启用拓扑，并且存在的任何错误都将生成错误要素。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Only generate errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _only_generate_errors_value _only_generate_errors { get; set; } = _only_generate_errors_value._false;

        public enum _only_generate_errors_value
        {
            /// <summary>
            /// <para>ONLY_ERRORS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ONLY_ERRORS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ENABLE_TOPO</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ENABLE_TOPO")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Trace Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Trace Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_trace_network { get; set; }


        public EnableNetworkTopology SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}